using DG.Tweening;
using DG.Tweening.Core;
using UnityEngine;

namespace WorkFlow.TweenGo
{
    public class SpriteAlphaTween : TweenGoBase<SpriteRenderer,float>
    {
        protected override Tweener CreateTween(DOGetter<float> startValueGetter, DOSetter<float> setter, float endValue, float duration)
        {
            return DOTween.To(startValueGetter,SetValue, endValue, duration);
        }

        protected override void SetValue(float value)
        {
            var color = Target.color;
            color.a = value;
            Target.color = color;
        }
    }
}
